<!-- 报销 -->
<template>
	<view style="background-color: #F7F7F7;">
		<!-- tabs展示主体区域 -->
		<view class="tabsContainer">
			<!-- <swiper class="swiper_base" @change="swiperChange" :current="swiperCurrent"> -->
			<!-- 我加入的企业 -->
			<!-- 2.报销 -->
			<!-- <swiper-item> -->
			<view class="search_bar" v-if="projectFinnaceCurrent == '2'">
				<view class="search_left" @click="select()">
					<image src="../../../static/client/shaixuan.png" class="search_left_img"></image>
				</view>
				<input class="search_bar_input" v-model="searchInfo" placeholder="请输入"
					placeholder-class="search_input_text" />
				<!-- <image src="../../../static/client/sousuo.png" class="sousuo_img" @click="handleSearch"></image> -->
				<view class="all_sousuo_img" @click="handleSearch">
					<image src="../../../static/client/sousuo.png"
						style="width: 38rpx;height: 34rpx;margin-top: 20rpx;margin-left: 20rpx;"></image>
				</view>

				<view class="select_query" v-if="select_query">
					<!-- 日期选择器 -->
					<text class="select_query_text">创建时间</text>
					<picker mode="date" @change="bindStartDateChange" style="width:250rpx ;height: 60rpx;">
						<view class="picker_input">{{ date_start }}</view>
					</picker>
					<view
						style="width: 15rpx;height: 3rpx; margin-left: 438rpx;margin-top: -30rpx; background: #999999;">
					</view>
					<picker mode="date" @change="bindEndDateChange" style="width:250rpx ;height: 60rpx;">
						<view class="picker_input" style="margin-left: 470rpx;margin-top: -32rpx;">
							{{ date_end }}
						</view>
					</picker>
					<!-- 提交人 -->
					<view class="select_query_text" style="margin-top: 62rpx;">提交人</view>
					<input type="text" v-model="insider" class="select_input" name="input"
						style="margin-top: -50rpx;" placeholder="请选择" disabled="false"
						placeholder-style="font-size: 26rpx;font-family: PingFang SC;font-weight: 500;color: #999999;"
						 @click="userSelectShow()"/>
						 <view class="all_select_input_cancel" v-show="insider != ''" @click="selectUserCancel()">
							 ×
						 </view>
					<!-- 提交人结束 -->
					<!-- 多层部门人员选择 -->
					<view class="all_user_select_plus" v-show="insider_select_show">
						<view class="all_tab_line">
							<scroll-view scroll-x="true" enhanced="true" style="white-space: nowrap;">
								<view class="all_tab_item" v-for="(item,index) in userSelectTabLine"
									:style="item.show_name == userSelectTabLine[userSelectTabLine.length-1].show_name ?'color: #128bf1;':''"
									@click="tapSelectTab(item,index)">
									{{item.show_name}}
								</view>
							</scroll-view>
						</view>
					
						<view class="all_user_select_show">
							<scroll-view scroll-y="true" style="height: 360rpx;">
								<view v-for="item in userSelectList" class="all_select_item" @click="tapSelector(item)"
									:style="item.is_department == 1?'color:#128bf1':''">
									{{item.show_name}}
								</view>
							</scroll-view>
						</view>
					</view>
					<!-- 多层部门人员选择结束 -->
					
					<!-- 模糊查询 -->
					<view class="select_query_text" style="margin-top: 62rpx;">模糊查询</view>
					<input type="text" v-model="searchInfo" class="select_input" name="input"
						style="margin-top: -50rpx;" placeholder="请输入"
						placeholder-style="font-size: 26rpx;font-family: PingFang SC;font-weight: 500;color: #999999;" />
					<!-- 模糊查询结束 -->
					<!-- 取消确定按钮 -->
					<view style="margin-top: 65rpx;">
						<button class="query_button_cancel" @click="handelCancel" style="">
							取消
						</button>
						<button class="query_button_confirm" @click="handleSearchSlideClick" style="">
							确定
						</button>
					</view>
					<!-- 项目类型下拉列表 -->
					<view class="project_item" v-if="proItemShow">
						<view class="item_info" :class="
								search_project_type == item.project_type_id
									? 'selectSlideItemActive'
									: ''
							" v-for="(item, index) in projectTypeList" :key="item.project_type_id" @tap="tapProItem(item)">
							<text style="margin-left: 21rpx;">{{ item.project_type_name }}</text>
						</view>
					</view>
				</view>
			</view>
			<!-- 筛选查询框 -->
			<scroll-view scroll-y class="tabsItem tabs1" style="height: calc(100vh - 135rpx);"
				v-if="projectFinnaceCurrent == '2'">
				<!-- 筛选查询框结束 -->
				<view class="finnaceList">
					<uni-swipe-action>
						<uni-swipe-action-item v-for="item in tableData1" :key="item" :right-options="options"
							@click="bindClick1(item.id)">
							<view class="listItem"
								style="border-bottom: 4rpx solid #F7F7F7;padding-top: 10rpx;padding-bottom: 20rpx;"
								@click="checkItem1(item)">
								<view class="itemLine2" style="font-size: 28rpx;">
									{{item.title}}
								</view>

								<view class="itemLine2">
									<view class="type" v-if="item.type == '1'">
										{{ '类型：' + '项目实施相关费用' }}
									</view>
									<view class="type" v-else-if="item.type == '2'">
										{{ '类型：' + '业务相关费用' }}
									</view>
									<view class="type" v-else-if="item.type == '3'">
										{{ '类型：' + '招待费' }}
									</view>
									<view class="type" v-else-if="item.type == '4'">
										{{ '类型：' + '其他' }}
									</view>
									<view class="type" v-else>{{ '类型：' + '--' }}</view>

									<view class="" style="font-size: 24rpx;position: absolute;left: 400rpx;">
										<text style="color: #666666;">金额:</text>
										<text style="color: #FF3333;">{{ item.total + '元' }}</text>
									</view>

								</view>

								<view class="itemLine2">
									<view class="type">
										<text style="color: #999999">申请人:</text>
										<text style="color: #128BF1;margin-left: 20rpx;">{{item.member.nickname}}</text>
									</view>

									<view class="type rightStatus2 all_flex_row" v-if="item.show_state_people != ''">
										<text>当前处理人:</text>
										<text class="all_text_overflow"
											style="color: #128BF1;margin-left: 10rpx;">{{item.show_state_people}}</text>
									</view>
									<view class="rightStatus2" v-else>
										{{ item.show_state }}
									</view>
								</view>
							</view>

						</uni-swipe-action-item>
					</uni-swipe-action>
					<!-- 加载更多 -->
					<view style="width: 100%;">
						<uni-load-more :status="status1" iconType="auto" @clickLoadMore="getMoreFinnace1">
						</uni-load-more>
					</view>
					<view class="add_client" v-if="linkedShow != '1'">
						<image src="../../../static/client/tianjia.png" style="width: 137rpx;height: 137rpx;"
							@click="handleGoAdd('1')"></image>
					</view>
				</view>
			</scroll-view>
			<!-- </swiper-item> -->


			<!-- </swiper> -->
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userSelectTabLine: [{	// -------多级人员选择
					show_name: '部门选择'
				}],
				userSelectList: [],
				userList: [],
				insider: '', //提交人员
				insiderId: '', //提交人员Id
				insider_select_show: false,
				
				cache_department_id: '',
				tableData1: [],
				tableData2: [],
				tableData3: [],
				tableData4: [],
				tableData5: [],
				tableData6: [],
				pageNum1: 0,
				pageNum2: 0,
				pageNum3: 0,
				pageNum4: 0,
				pageNum5: 0,
				pageNum6: 0,
				pageSize1: 10,
				pageSize2: 10,
				pageSize3: 10,
				pageSize4: 10,
				pageSize5: 10,
				pageSize6: 10,
				currentPage1: 1,
				currentPage2: 1,
				currentPage3: 1,
				currentPage4: 1,
				currentPage5: 1,
				currentPage6: 1,
				totle1: 0,
				totle2: 0,
				totle3: 0,
				totle4: 0,
				totle5: 0,
				totle6: 0,
				searchInfo: '',
				projectType: '',
				date_start: '',
				date_end: '',
				financeIndexData: {},
				startDate: '',
				endDate: '',
				select_query: false,
				status1: 'more',
				status2: 'more',
				status3: 'more',
				status4: 'more',
				status5: 'more',
				status6: 'more',
				pageNum: 0,
				token: '',
				member_id: '',
				company_id: '',
				projectFinnaceCurrent: '2',
				projectTypeList: [{
					project_type_id: '1',
					project_type_name: '1'
				}],
				proItemShow: false,
				swiperCurrent: 0,
				options: [{
					text: '删除',
					style: {
						backgroundColor: '#dd524d'
					}
				}],
				
				isRefresh:2,//是否刷新页面 1是 2否
				linkedShow:'',//是否展示项目相关列表 1是
				project_id:'',
			};
		},
		onPullDownRefresh() {
			this.status1 = 'more';
			this.status2 = 'more';
			this.status3 = 'more';
			this.status4 = 'more';
			this.status5 = 'more';
			this.status6 = 'more';
			this.currentPage1 = 1;
			this.currentPage2 = 1;
			this.currentPage3 = 1;
			this.currentPage4 = 1;
			this.currentPage5 = 1;
			this.currentPage6 = 1;
			this.tableData1 = [];
			this.tableData2 = [];
			this.tableData3 = [];
			this.tableData4 = [];
			this.tableData5 = [];
			this.tableData6 = [];
			this.getReimbursementList();
			// this.getFinnaceLook();
			this.getUserList();
		},
		onShow() {
			if(this.isRefresh == 1){
				this.status1 = 'more';
				this.status2 = 'more';
				this.status3 = 'more';
				this.status4 = 'more';
				this.status5 = 'more';
				this.status6 = 'more';
				this.currentPage1 = 1;
				this.currentPage2 = 1;
				this.currentPage3 = 1;
				this.currentPage4 = 1;
				this.currentPage5 = 1;
				this.currentPage6 = 1;
				this.tableData1 = [];
				this.tableData2 = [];
				this.tableData3 = [];
				this.tableData4 = [];
				this.tableData5 = [];
				this.tableData6 = [];
				this.getReimbursementList();
				// this.getFinnaceLook();
				this.getUserList();
				
				this.isRefresh = 2;
			}
		},
		onLoad(options) {
			this.token = uni.getStorageSync('btlh_process_token') || '';
			this.member_id = uni.getStorageSync('btlh_process_member_id') || '';
			this.company_id = uni.getStorageSync('bthl_process_LoginCompanyId') || '';
			this.cache_department_id = uni.getStorageSync('cache_department_id') || '';
			this.project_id = options.project_id || '';
			this.linkedShow = options.linked_show || '';
			if(this.linkedShow == '1'){
				uni.setNavigationBarTitle({
					title:'相关报销申请'
				})
			}
			this.status1 = 'more';
			this.status2 = 'more';
			this.status3 = 'more';
			this.status4 = 'more';
			this.status5 = 'more';
			this.status6 = 'more';
			this.currentPage1 = 1;
			this.currentPage2 = 1;
			this.currentPage3 = 1;
			this.currentPage4 = 1;
			this.currentPage5 = 1;
			this.currentPage6 = 1;
			this.tableData1 = [];
			this.tableData2 = [];
			this.tableData3 = [];
			this.tableData4 = [];
			this.tableData5 = [];
			this.tableData6 = [];
			this.getReimbursementList();
			// this.getFinnaceLook();
			this.getUserList();
			// if (options.type) {
			// 	if(options.type=='2'){
			// 		console.log(12312312312312123)
			// 		this.projectFinnaceCurrent = '2'
			// 		this.getReimbursementList()
			// 	}
			// }
		},
		methods: {
			// 消除人员
			selectUserCancel(){
				this.insider = '';
				this.insiderId = '';
				this.insider_select_show = false;
			},
			// 获取人员列表
			async getUserList() {
				const {
					data: res
				} = await this.$myRequest({
					url: 'Management/simple_member',
					method: 'POST',
					data: {
						member_id: this.member_id,
						token: this.token,
						company_id: this.company_id
					}
				});
				if (res.code != 200)
					return uni.showToast({
						title: res.datas.msg,
						icon: 'none'
					});
				this.userList = res.datas.listInfo;
				this.userSelectList = this.userList;
				// 数组反转将部门放在前
				for (let i = 0; i < this.userSelectList.length; i++) {
					this.userSelectList[i].children.reverse();
				}
				console.log('用户列表(选择框)', this.userList);
			},
			// tab点击
			tapSelectTab(item, index) {
				// 判断是否点击第一个元素
				if (index == 0) {
					this.userSelectList = this.userList;
					this.userSelectTabLine = [{
						show_name: '部门选择'
					}]
				} else {
					this.userSelectTabLine = this.userSelectTabLine.slice(0, index + 1);
					this.userSelectList = item.children;
				}
			},
			// 多级列表点击
			tapSelector(item) {
				// 0不是部门 1是部门
				if (item.is_department == 0) {
					this.insider = item.show_name;
					this.insiderId = item.id;
					this.insider_select_show = false;
				} else if (item.is_department == 1) {
					this.userSelectList = item.children;
					console.log('reverse')
					//判断如果部门已加入tab栏则不加入
					if (!this.userSelectTabLine.includes(item)) {
						this.userSelectTabLine.push(item);
					}
				}
			},
			// 点击显示评价人员选择框
			userSelectShow() {
				this.insider_select_show = !this.insider_select_show;
			},
			
			// 6合同登记
			async getContractList() {
				const {
					data: res
				} = await this.$myRequest({
					url: 'Finance/contract',
					method: 'POST',
					data: {
						member_id: this.member_id,
						token: this.token,
						company_id: this.company_id,

						search: this.searchInfo,
						project_type: this.projectType,
						date_start: this.date_start,
						date_end: this.date_end,
						// p: 1,
						// p_count: 10 + this.pageNum5 * 5
						p: this.currentPage6,
						p_count: this.pageSize6
					}
				});
				if (res.code != 200)
					return uni.showToast({
						title: res.datas.msg,
						icon: 'none'
					});
				// this.tableData6 = res.datas.listInfo;
				this.tableData6 = [...this.tableData6, ...res.datas.listInfo];
				this.totle6 = parseInt(res.datas.count);
				console.log('合同登记', this.tableData6);
			},
			// 5业务结算
			async getBusinessList() {
				const {
					data: res
				} = await this.$myRequest({
					url: 'Finance/business',
					method: 'POST',
					data: {
						member_id: this.member_id,
						token: this.token,
						company_id: this.company_id,

						search: this.searchInfo,
						date_start: this.date_start,
						date_end: this.date_end,
						// p: 1,
						// p_count: 10 + this.pageNum5 * 5,
						p: this.currentPage5,
						p_count: this.pageNum5
					}
				});
				if (res.code != 200)
					return uni.showToast({
						title: res.datas.msg,
						icon: 'none'
					});
				// this.tableData5 = res.datas.listInfo;
				this.tableData5 = [...this.tableData5, ...res.datas.listInfo];
				this.totle5 = parseInt(res.datas.count);
				console.log('业务结算', this.tableData5);
			},
			// 4到账记录
			async getArrivalList() {
				const {
					data: res
				} = await this.$myRequest({
					url: 'Finance/arrival',
					method: 'POST',
					data: {
						member_id: this.member_id,
						token: this.token,
						company_id: this.company_id,

						search: this.searchInfo,
						date_start: this.date_start,
						date_end: this.date_end,
						// p: 1,
						// p_count: 10 + this.pageNum4 * 5
						p: this.currentPage4,
						p_count: this.pageSize4
					}
				});
				if (res.code != 200)
					return uni.showToast({
						title: res.datas.msg,
						icon: 'none'
					});
				// this.tableData4 = res.datas.listInfo;
				this.tableData4 = [...this.tableData4, ...res.datas.listInfo];
				this.totle4 = parseInt(res.datas.count);
				console.log('到账记录列表', this.tableData4);
			},
			// 3获取项目专家费
			async getExpertList() {
				const {
					data: res
				} = await this.$myRequest({
					url: 'Finance/expert',
					method: 'POST',
					data: {
						member_id: this.member_id,
						token: this.token,
						company_id: this.company_id,

						search: this.searchInfo,
						date_start: this.date_start,
						date_end: this.date_end,
						// p: 1,
						// p_count: 10 + this.pageNum3 * 5
						p: this.currentPage3,
						p_count: this.pageSize3
					}
				});
				if (res.code != 200)
					return uni.showToast({
						title: res.datas.msg,
						icon: 'none'
					});
				// this.tableData3 = res.datas.listInfo;
				this.tableData3 = [...this.tableData3, ...res.datas.listInfo];
				this.totle3 = parseInt(res.datas.count);
				console.log('项目专家费列表', this.tableData3);
			},
			// 2获取项目结算列表
			async getSettlementList() {
				const {
					data: res
				} = await this.$myRequest({
					url: 'Finance/settlement',
					method: 'POST',
					data: {
						member_id: this.member_id,
						token: this.token,
						company_id: this.company_id,

						search: this.searchInfo,
						date_start: this.date_start,
						date_end: this.date_end,
						// p: 1,
						// p_count: 10 + this.pageNum2 * 5
						p: this.currentPage2,
						p_count: this.pageSize2
					}
				});
				if (res.code != 200)
					return uni.showToast({
						title: res.datas.msg,
						icon: 'none'
					});
				// this.tableData2 = res.datas.listInfo;
				this.tableData2 = [...this.tableData2, ...res.datas.listInfo];
				this.totle2 = parseInt(res.datas.count);
				console.log('项目结算列表', this.tableData2);
			},
			// 1获取报销列表
			async getReimbursementList() {
				if(this.linkedShow == '1'){
					const {
						data: res
					} = await this.$myRequest({
						url: 'Finance/ass_reimbursement',
						method: 'POST',
						data: {
							member_id: this.member_id,
							token: this.token,
							company_id: this.company_id,
							project_id:this.project_id,
							
							cache_department_id: this.cache_department_id,
							search: this.searchInfo,
							date_start: this.date_start,
							date_end: this.date_end,
							search_member_id:this.insiderId,
							// p: 1,
							// p_count: 10 + this.pageNum1 * 5
							p: this.currentPage1,
							p_count: this.pageSize1
						}
					});
					if (res.code != 200)
						return uni.showToast({
							title: res.datas.msg,
							icon: 'none'
						});
					// this.tableData1 = res.datas.listInfo;
					this.tableData1 = [...this.tableData1, ...res.datas.listInfo] || [];
					this.totle1 = parseInt(res.datas.count);
					console.log('报销列表', this.tableData1);
					console.log(this.pageNum1);
				}else{
					const {
						data: res
					} = await this.$myRequest({
						url: 'Finance/reimbursement',
						method: 'POST',
						data: {
							member_id: this.member_id,
							token: this.token,
							company_id: this.company_id,
							cache_department_id: this.cache_department_id,
							search: this.searchInfo,
							date_start: this.date_start,
							date_end: this.date_end,
							search_member_id:this.insiderId,
							// p: 1,
							// p_count: 10 + this.pageNum1 * 5
							p: this.currentPage1,
							p_count: this.pageSize1
						}
					});
					if (res.code != 200)
						return uni.showToast({
							title: res.datas.msg,
							icon: 'none'
						});
					// this.tableData1 = res.datas.listInfo;
					this.tableData1 = [...this.tableData1, ...res.datas.listInfo] || [];
					this.totle1 = parseInt(res.datas.count);
					console.log('报销列表', this.tableData1);
					console.log(this.pageNum1);
				}
				
				
			},
			// 1查看报销详情
			checkItem1(item) {
				if (item.id) {
					uni.navigateTo({
						url: `/pages/finnace/finnaceDispatch?finnaceId=${item.id}`
					});
				}
			},
			checkItem2(item) {
				if (item.id) {
					uni.navigateTo({
						url: `/pages/finnace/finnaceAccount?finnaceId=${item.id}`
					});
				}
			},
			checkItem3(item) {
				if (item.id) {
					uni.navigateTo({
						url: `/pages/finnace/finnaceExpert?finnaceId=${item.id}`
					});
				}
			},
			checkItem4(item) {
				if (item.id) {
					uni.navigateTo({
						url: `/pages/finnace/finnaceSend?finnaceId=${item.id}`
					});
				}
			},
			checkItem5(item) {
				if (item.id) {
					uni.navigateTo({
						url: `/pages/finnace/finnaceBusiness?finnaceId=${item.id}`
					});
				}
			},
			checkItem6(item) {
				if (item.id) {
					uni.navigateTo({
						url: `/pages/finnace/finnaceContract?finnaceId=${item.id}`
					});
				}
			},
			// 获取总览
			async getFinnaceLook() {
				const {
					data: res
				} = await this.$myRequest({
					url: 'Finance/index',
					method: 'POST',
					data: {
						member_id: this.member_id,
						token: this.token,
						company_id: this.company_id
					}
				});
				if (res.code != 200)
					return uni.showToast({
						title: res.datas.msg,
						icon: 'none'
					});
				this.financeIndexData = res.datas;
				console.log('财务总览', this.financeIndexData);
			},
			// 搜索按钮点击
			handleSearch() {
				uni.showLoading({
					title: '请求中~~'
				});
				this.currentPage1 = 1;
				this.tableData1 = [];
				this.status1 = 'more';
				this.getReimbursementList();
			},
			handleSearchSlideClick() {
				uni.showLoading({
					title:'请求中~~'
				});
				this.currentPage1 = 1;
				this.tableData1 = [];
				this.status1 = 'more';
				this.getReimbursementList();
				this.select_query = false;
				this.searchInfo = '';
				this.date_start = '';
				this.date_end = '';
				this.projectType = '';
			},
			// 1删除报销
			bindClick1(id, e) {
				console.log(id);
				uni.showModal({
					title: '提示',
					content: '确定删除此条申请吗？',
					success: async res => {
						if (res.confirm) {
							// 删除
							const {
								data: res
							} = await this.$myRequest({
								url: 'Finance/reimbursement_del',
								method: 'POST',
								data: {
									member_id: this.member_id,
									token: this.token,
									company_id: this.company_id,

									finance_id: id
								}
							});
							if (res.code != 200)
								return uni.showToast({
									title: res.datas.msg,
									icon: 'none'
								});
							uni.showToast({
								title: res.datas.msg,
								icon: 'none'
							});
							this.currentPage1 = 1;
							this.tableData1 = [];
							this.status1 = 'more';
							this.getReimbursementList();
						} else if (res.cancel) {
							console.log('用户点击取消');
						}
					}
				});
			},
			// 2删除项目结算
			bindClick2(id, e) {
				uni.showModal({
					title: '提示',
					content: '确定删除此条报销吗？',
					success: async res => {
						if (res.confirm) {
							// 删除
							const {
								data: res
							} = await this.$myRequest({
								url: 'Finance/settlement_del',
								method: 'POST',
								data: {
									member_id: this.member_id,
									token: this.token,
									company_id: this.company_id,

									finance_id: id
								}
							});
							if (res.code != 200)
								return uni.showToast({
									title: res.datas.msg,
									icon: 'none'
								});
							uni.showToast({
								title: res.datas.msg,
								icon: 'none'
							});
							this.currentPage2 = 1;
							this.tableData2 = [];
							this.status2 = 'more';
							this.getSettlementList();
						} else if (res.cancel) {
							console.log('用户点击取消');
						}
					}
				});
			},
			// 3删除专家费申请
			bindClick3(id, e) {
				uni.showModal({
					title: '提示',
					content: '确定删除此条报销吗？',
					success: async res => {
						if (res.confirm) {
							// 删除
							const {
								data: res
							} = await this.$myRequest({
								url: 'Finance/expert_del',
								method: 'POST',
								data: {
									member_id: this.member_id,
									token: this.token,
									company_id: this.company_id,

									finance_id: id
								}
							});
							if (res.code != 200)
								return uni.showToast({
									title: res.datas.msg,
									icon: 'none'
								});
							uni.showToast({
								title: res.datas.msg,
								icon: 'none'
							});
							this.currentPage3 = 1;
							this.tableData3 = [];
							this.status3 = 'more';
							this.getExpertList();
						} else if (res.cancel) {
							console.log('用户点击取消');
						}
					}
				});
			},
			// 4删除到账记录
			bindClick4(id, e) {
				uni.showModal({
					title: '提示',
					content: '确定删除此条报销吗？',
					success: async res => {
						if (res.confirm) {
							// 删除
							const {
								data: res
							} = await this.$myRequest({
								url: 'Finance/arrival_del',
								method: 'POST',
								data: {
									member_id: this.member_id,
									token: this.token,
									company_id: this.company_id,

									finance_id: id
								}
							});
							if (res.code != 200)
								return uni.showToast({
									title: res.datas.msg,
									icon: 'none'
								});
							uni.showToast({
								title: res.datas.msg,
								icon: 'none'
							});
							this.currentPage4 = 1;
							this.tableData4 = [];
							this.status4 = 'more';
							this.getArrivalList();
						} else if (res.cancel) {
							console.log('用户点击取消');
						}
					}
				});
			},
			// 5.删除业务结算
			bindClick5(id, e) {
				uni.showModal({
					title: '提示',
					content: '确定删除此条报销吗？',
					success: async res => {
						if (res.confirm) {
							// 删除
							const {
								data: res
							} = await this.$myRequest({
								url: 'Finance/business_del',
								method: 'POST',
								data: {
									member_id: this.member_id,
									token: this.token,
									company_id: this.company_id,

									finance_id: id
								}
							});
							if (res.code != 200)
								return uni.showToast({
									title: res.datas.msg,
									icon: 'none'
								});
							uni.showToast({
								title: res.datas.msg,
								icon: 'none'
							});
							this.currentPage5 = 1;
							this.tableData5 = [];
							this.status5 = 'more';
							this.getBusinessList();
						} else if (res.cancel) {
							console.log('用户点击取消');
						}
					}
				});
			},
			// 6.删除合同登记
			bindClick6(id, e) {
				uni.showModal({
					title: '提示',
					content: '确定删除此条报销吗？',
					success: async res => {
						if (res.confirm) {
							// 删除
							const {
								data: res
							} = await this.$myRequest({
								url: 'Finance/contract_del',
								method: 'POST',
								data: {
									member_id: this.member_id,
									token: this.token,
									company_id: this.company_id,

									finance_id: id
								}
							});
							if (res.code != 200)
								return uni.showToast({
									title: res.datas.msg,
									icon: 'none'
								});
							uni.showToast({
								title: res.datas.msg,
								icon: 'none'
							});
							this.currentPage6 = 1;
							this.tableData6 = [];
							this.status6 = 'more';
							this.getContractList();
						} else if (res.cancel) {
							console.log('用户点击取消');
						}
					}
				});
			},
			// 点击加载更多1
			getMoreFinnace1() {
				if (this.totle1 > this.tableData1.length) {
					this.status1 = 'loading';
					// this.pageNum1++;
					this.currentPage1++;
					this.getReimbursementList(); //执行的方法
					this.status1 = 'more';
				} else {
					//停止加载
					this.status1 = 'noMore';
				}
			},
			// 点击加载更多2
			getMoreFinnace2() {
				if (this.totle2 > this.tableData2.length) {
					this.status2 = 'loading';
					// this.pageNum2++;
					this.currentPage2++;
					this.getSettlementList(); //执行的方法
					this.status2 = 'more';
				} else {
					//停止加载
					this.status2 = 'noMore';
				}
			},
			// 点击加载更多3
			getMoreFinnace3() {
				if (this.totle3 > this.tableData3.length) {
					this.status3 = 'loading';
					// this.pageNum3++;
					this.currentPage3++;
					this.getExpertList(); //执行的方法
					this.status3 = 'more';
				} else {
					//停止加载
					this.status3 = 'noMore';
				}
			},
			// 点击加载更多4
			getMoreFinnace4() {
				if (this.totle4 > this.tableData4.length) {
					this.status4 = 'loading';
					// this.pageNum4++;
					this.currentPage4++;
					this.getArrivalList(); //执行的方法
					this.status4 = 'more';
				} else {
					//停止加载
					this.status4 = 'noMore';
				}
			},
			// 点击加载更多5
			getMoreFinnace5() {
				if (this.totle5 > this.tableData5.length) {
					this.status5 = 'loading';
					// this.pageNum5++;
					this.currentPage5++;
					this.getBusinessList(); //执行的方法
					this.status5 = 'more';
				} else {
					//停止加载
					this.status5 = 'noMore';
				}
			},
			// 点击加载更多6
			getMoreFinnace6() {
				if (this.totle6 > this.tableData6.length) {
					this.status6 = 'loading';
					// this.pageNum6++;
					this.currentPage6++;
					this.getContractList(); //执行的方法
					this.status6 = 'more';
				} else {
					//停止加载
					this.status6 = 'noMore';
				}
			},
			swiperChange(e) {
				this.swiperCurrent = e.detail.current;
				switch (this.swiperCurrent) {
					case 0:
						this.projectFinnaceCurrent = '1';
						break;
					case 1:
						this.projectFinnaceCurrent = '2';
						break;
					case 2:
						this.projectFinnaceCurrent = '3';
						break;
					case 3:
						this.projectFinnaceCurrent = '4';
						break;
					case 4:
						this.projectFinnaceCurrent = '5';
						break;
					case 5:
						this.projectFinnaceCurrent = '6';
						break;
				}
			},
			handleTabsBarClick(val) {
				this.projectFinnaceCurrent = val;
				switch (val) {
					case '1':
						this.swiperCurrent = 0;
						this.getFinnaceLook();
						break;
					case '2':
						this.swiperCurrent = 1;
						this.currentPage1 = 1;
						this.tableData1 = [];
						this.getReimbursementList();
						break;
					case '3':
						this.swiperCurrent = 2;
						this.currentPage2 = 1;
						this.tableData2 = [];
						this.getSettlementList();
						break;
					case '4':
						this.swiperCurrent = 3;
						this.currentPage3 = 1;
						this.tableData3 = [];
						this.getExpertList();
						break;
					case '5':
						this.swiperCurrent = 4;
						this.currentPage4 = 1;
						this.tableData4 = [];
						this.getArrivalList();
						break;
					case '6':
						this.swiperCurrent = 5;
						this.currentPage5 = 1;
						this.tableData5 = [];
						this.getBusinessList();
						break;
					case '7':
						this.swiperCurrent = 6;
						this.currentPage6 = 1;
						this.tableData6 = [];
						this.getContractList();
						break;
				}
				console.log(this.swiperCurrent);
			},
			handleGoAdd(val) {
				switch (val) {
					case '1':
						uni.navigateTo({
							url: '/pages/finnace/finnaceDispatch'
						});
						break;
					case '2':
						uni.navigateTo({
							url: '/pages/finnace/finnaceAccount'
						});
						break;
					case '3':
						uni.navigateTo({
							url: '/pages/finnace/finnaceExpert'
						});
						break;
					case '4':
						uni.navigateTo({
							url: '/pages/finnace/finnaceSend'
						});
						break;
					case '5':
						uni.navigateTo({
							url: '/pages/finnace/finnaceBusiness'
						});
						break;
					case '6':
						uni.navigateTo({
							url: '/pages/finnace/finnaceContract'
						});
						break;
				}
				this.isRefresh = 1;
			},
			bindStartDateChange(e) {
				this.date_start = e.target.value;
			},
			bindEndDateChange(e) {
				this.date_end = e.target.value;
			},
			handleProItemsShow() {
				this.proItemShow = !this.proItemShow;
			},
			// 点击选择项目类型
			tapProItem(item) {
				console.log(item);
				this.project_name = item.project_type_name;
				this.search_project_type = item.project_type_id;
				this.proItemShow = false;
			},
			handelCancel() {
				this.searchInfo = '';
				this.date_start = '';
				this.date_end = '';
				this.select_query = false;
				this.insider = '';
				this.insiderId = '';
			},
			// 点击筛选查询按钮显示查询框
			select() {
				this.select_query = !this.select_query;
			},
			// 点击左上返回按钮
			back() {
				uni.navigateBack({
					delta: 1
				});
			}
		}
	};
</script>

<style scoped lang="scss">
	.itemLine2 {
		position: relative;
		margin-left: 30rpx;
		margin-top: 10rpx;
		display: flex;
		flex-direction: row;

		.type {
			font-size: 24rpx;
			color: #999;
		}
	}


	.rightStatus2 {
		font-size: 24rpx;
		color: #999;
		position: absolute;
		left: 400rpx;
	}

	.head_text {
		width: 100%;
		height: 128rpx;
		font-size: 36rpx;
		font-family: PingFang SC;
		font-weight: bold;
		color: #333333;
		line-height: 160rpx;
		text-align: center;
		border-bottom: 2rpx solid #f7f7f7;
	}

	// 导航栏头部点击部分
	.tabsBarHeader {
		display: flex;
		background-color: #fff;

		.barHeaderItem {
			// display: flex;
			display: inline-block;
			justify-content: center;
			align-items: center;
			height: 70rpx;
			font-size: 30rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #666666;
			box-sizing: border-box;
			text-align: center;
			position: relative;
		}

		.tabsCurrentHeader {
			color: #128bf1;
		}

		.tabsCurrentHeader::before {
			content: '';
			height: 4rpx;
			width: 88%;
			background-color: #40a0f2;
			border-radius: 2rpx;
			position: absolute;
			bottom: 0;
			left: 10rpx;
		}
	}

	// tabs主体区域
	.tabsContainer {
		.tabsItem {
			background-color: #f7f7f7;
			position: relative;

			.finnaceList {

				// height: auto;
				.listItem {
					background-color: #fff;

					.itemTitle {
						width: 100%;
						overflow: hidden;
						white-space: nowrap;
						text-overflow: ellipsis;
						min-height: 20rpx;
						font-size: 28rpx;
						font-family: PingFang SC;
						font-weight: 500;
						color: #333333;
						padding-top: 35rpx;
						margin-left: 30rpx;
					}

					.itemInfo {
						display: flex;
						justify-content: space-between;
						align-items: center;
						padding-bottom: 30rpx;
						margin-bottom: 5rpx;

						.type {
							width: 220rpx;
							overflow: hidden;
							white-space: nowrap;
							text-overflow: ellipsis;
							font-size: 24rpx;
							font-family: PingFang SC;
							font-weight: 500;
							color: #999999;
							margin-left: 30rpx;
						}

						.num {
							width: 200rpx;
							font-size: 24rpx;
							overflow: hidden;
							white-space: nowrap;
							text-overflow: ellipsis;
							font-family: PingFang SC;
							font-weight: 500;
							color: #666666;
						}

						.rightStatus {
							width: 250rpx;
							margin-right: 30rpx;
							text-align: right;
						}
					}
				}
			}
		}

		// 2.报销
		.tabs2 {}

		// 1.概览
		.tabs1 {
			margin-top: 20rpx;

			.overviewRow {
				background-color: #fff;

				.rowTitle {
					height: 102rpx;
					display: flex;
					align-items: center;
					border-bottom: 1px solid #efefef;

					.line {
						width: 6rpx;
						height: 42rpx;
						margin-left: 30rpx;
						margin-right: 23rpx;
						background: #40a0f2;
					}

					.titleText {
						font-size: 32rpx;
						font-family: PingFang SC;
						font-weight: bold;
						color: #333333;
					}
				}

				.rowBody {
					box-sizing: border-box;
					padding: 0 45rpx;
					padding-top: 26rpx;
					display: flex;
					flex-wrap: wrap;
					justify-content: space-between;

					.rowBodyItem {
						width: 317rpx;
						height: 147rpx;
						background: url(../../../static/images/projectfinnal_1.png) no-repeat;
						background-size: 100% 100%;

						.num {
							font-size: 30rpx;
							font-family: PingFang SC;
							font-weight: 500;
							color: #ffffff;
							margin-top: 33rpx;
							margin-left: 48rpx;
						}

						.title {
							font-size: 26rpx;
							font-family: PingFang SC;
							font-weight: 500;
							color: #ffffff;
							margin-left: 76rpx;
						}
					}

					.rowBodyItem2 {
						background: url(../../../static/images/projectfinnal_2.png) no-repeat;
						background-size: 100% 100%;
					}

					.rowBodyItem3 {
						margin-top: 13rpx;
						background: url(../../../static/images/projectfinnal_3.png) no-repeat;
						background-size: 100% 100%;
					}

					.rowBodyItem4 {
						background: url(../../../static/images/projectfinnal_4.png) no-repeat;
						background-size: 100% 100%;
					}

					.rowBodyItem5 {
						background: url(../../../static/images/projectfinnal_5.png) no-repeat;
						background-size: 100% 100%;
					}

					.rowBodyItem6 {
						margin-top: 13rpx;
						background: url(../../../static/images/projectfinnal_6.png) no-repeat;
						background-size: 100% 100%;
					}
				}
			}
		}
	}

	.add_client {
		width: 137rpx;
		height: 137rpx;
		position: fixed;
		right: 25rpx;
		bottom: 120rpx;
		z-index: 5;
	}

	.swiper_base {
		height: calc(100vh - 108rpx - 128rpx);
		// height: auto;
		// overflow-y: auto;
	}

	.search_bar {
		background-color: #fff;
		width: 100%;
		height: 92rpx;
		position: relative;
		border-bottom: 20rpx solid #f7f7f7;

		.search_bar_input {
			width: 450rpx;
			height: 72rpx;
			background: #f7f7f7;
			border: 1rpx solid #f7f7f7;
			border-radius: 36rpx 0 0 36rpx;
			margin-left: 136rpx;
			position: absolute;
			top: 10rpx;
			font-size: 26rpx;
			padding-left: 20rpx;

			.search_input_text {
				font-size: 26rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #b2b2b2;
				line-height: 37px;
				margin-left: 31rpx;
			}
		}

		.search_left_img {
			width: 46rpx;
			height: 36rpx;
			padding: 28rpx 30rpx;
		}

		.search_left {
			width: 106rpx;
			height: 92rpx;
			background: #40a0f2;
		}

		.sousuo_img {
			width: 38rpx;
			height: 34rpx;
			position: absolute;
			top: 28rpx;
			left: 650rpx;
			z-index: 99;
		}
	}

	.select_query {
		width: 100%;
		height: auto;
		background: #fff;
		position: absolute;
		top: 95rpx;
		z-index: 99;
		padding-top: 56rpx;
		box-shadow: 1px 3px 15px 0px rgba(3, 70, 126, 0.2);

		.select_query_text {
			font-size: 30rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #333333;
			margin-left: 30rpx;
		}

		.query_button_confirm {
			width: 375rpx;
			height: 80rpx;
			background: linear-gradient(0deg, #40a0f2 0%, #128bf1 100%);
			font-size: 30rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #ffffff;
			border-radius: 0;
			margin-right: 0;
			margin-top: -80rpx;
		}

		.query_button_cancel {
			width: 385rpx;
			height: 80rpx;
			border-radius: 0px;
			margin-left: 0;
			background: #ffffff;
			font-size: 30rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #999999;
		}

		.picker_input {
			width: 250rpx;
			height: 60rpx;
			background: #ffffff;
			border: 1px solid #dfdfdf;
			border-radius: 10rpx;
			font-size: 26rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #999999;
			line-height: 60rpx;
			text-align: center;
			margin-left: 170rpx;
			margin-top: -48rpx;
		}

		.select_input {
			width: 530rpx;
			height: 60rpx;
			background: #ffffff;
			border: 1rpx solid #dfdfdf;
			border-radius: 10px;
			margin-left: 170rpx;
			line-height: 60rpx;
			padding-left: 22rpx;
			position: relative;
			font-size: 26rpx;

			.select_input_text {
				font-size: 26rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #666666;
			}
		}
	}

	.project_item {
		width: 550rpx;
		height: 296rpx;
		background: #ffffff;
		box-shadow: 2rpx 3rpx 8rpx 0rpx rgba(0, 0, 0, 0.2);
		border-radius: 10px;
		position: absolute;
		top: 227rpx;
		right: 25rpx;
		z-index: 999;

		.item_info {
			width: 100%;
			height: 60rpx;
			font-size: 26rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #333333;
			line-height: 60rpx;
		}
	}

	.rightStatus {
		display: flex;
	}

	.overFlowName {
		// display: block;
		width: 100rpx;
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
	}
</style>
